<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>

  <body>
    <div id="div"></div>
    <script>
      var div = document.getElementById('div');
      div.innerHTML = 'loading...please wait...';
      // 异步
      setTimeout(function () {
        div.innerHTML = 'done1';
      }, 1000);
      setTimeout(function () {
        div.innerHTML = 'done2';
      }, 2000);
      setTimeout(function () {
        div.innerHTML = 'done3';
      }, 3000);
      setTimeout(function () {
        div.innerHTML = 'done4';
      }, 4000);
      setTimeout(function () {
        div.innerHTML = 'done5';
      }, 5000);
      //先loading...please wait...变成done1->done2->done3->done4->done5
    </script>
  </body>
</html>
